package com.example.test.advice.第八章_异常.建议110_提倡异常封装;

import java.util.ArrayList;
import java.util.List;

public class MyException extends Exception{

    //容纳所有的异常
    private List<Throwable> causes = new ArrayList<>();

    //构造函数，传一个异常列表
    public MyException(List<? extends Throwable> _causes){
        causes.addAll(_causes);
    }

    //读取所有的异常
    public List<Throwable> getExceptions(){

        return causes;
    }
}
